//
//  NSNull+ZZUtil.m
//  ZZKitDemo
//
//  Created by hfzhangzhang on 2018/8/14.
//  Copyright © 2018年 hfzhangzhang. All rights reserved.
//

#import "NSNull+ZZUtil.h"

@implementation NSNull (ZZUtil)
- (id)forwardingTargetForSelector:(SEL)aSelector {
    if ([self respondsToSelector:aSelector]) {
        return self;
    } else if ([NSString instancesRespondToSelector:aSelector]) {
        return @"";
    } else if ([NSNumber instancesRespondToSelector:aSelector]) {
        return @0;
    } else if ([NSArray instancesRespondToSelector:aSelector]) {
        return @[];
    } else if ([NSDictionary instancesRespondToSelector:aSelector]) {
        return @{};
    }
    return nil;
}
@end
